<%--
  Created by IntelliJ IDEA.
  User: LENOVO
  Date: 2024/9/27
  Time: 20:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <style>
    </style>
</head>
<body>
<form class="layui-form" method="post" action="/user/list/1">
    <div class="layui-form-item">
        <div class="layui-input-inline layui-input-wrap">
            <input type="text" name="name" value="${user.name}"placeholder="请输入姓名" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
        </div>
        <div class="layui-input-inline layui-input-wrap">
            <input type="text" name="pass" value="${user.pass}" placeholder="请输入密码" play-verify="required"  autocomplete="off" lay-affix="clear" class="layui-input">
        </div>
        <button type="submit" class="layui-btn" lay-submit lay-filter="demo1">查询</button>
        <a class="layui-btn" href="/user/toadd">新增用户</a>
    </div>
</form>
<table class="layui-table" lay-even>
    <colgroup>
        <col width="150">
        <col width="150">
        <col>
        <col>
    </colgroup>
    <thead>
    <tr>
        <th>编号</th>
        <th>姓名</th>
        <th>密码</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${users}" var="user">
        <tr>
            <td>${user.id}</td>
            <td>${user.name}</td>
            <td>${user.pass}</td>
            <td>
                <a href="/user/toupdate/${user.id}">修改</a>
                <a href="/user/delete/${user.id}">删除</a>
            </td>
        </tr>
    </c:forEach>
    <tr>
        <td colspan="4" >
            <a href="/user/list/1">首页</a>
            <c:if test="${page.currentPage != 1}">
                <a href="/user/list/${page.currentPage-1}">上一页</a>
            </c:if >
            第 ${page.currentPage} 页 / 共 ${page.totalPage} 页
            <c:if test="${page.currentPage != page.totalPage}">
                <a href="/user/list/${page.currentPage+1}">下一页</a>
            </c:if>
            <a href="/user/list/${page.totalPage}">尾页</a>
        </td>
    </tr>
    </tbody>
</table>
</body>
</html>
